-- 上机练习一
BEGIN;;
 INSERT INTO t_student (id,student_name,age,gender,birthday,classID,begin_year) VALUES(3006,'赵丽丽',20,'女','2003-09-18',3,2023);
 UPDATE t_student SET student_name='李达',age=21 WHERE id=3006;
 DELETE FROM t_student WHERE age<18;
COMMIT;
ROLLBACK;
-- 上机练习二
CREATE DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE test;
CREATE TABLE account(
id VARCHAR(20) PRIMARY KEY,
account_name VARCHAR(20) NOT NULL,
phone VARCHAR(11) NOT NULL,
balance DECIMAL(30,5)
);
INSERT INTO account VALUES ('6225214702630552','张三','13541522563',100);
INSERT INTO account VALUES ('6225214702630562','李四','13012123443',100);
-- 上机练习三
CREATE TABLE student(
id int PRIMARY KEY,
student_name VARCHAR(20) NOT NULL,
phone VARCHAR(11) NOT NULL,
gender ENUM('男','女'),
INDEX(student_name)
);
-- 上机练习四
CREATE VIEW view_stundent_san AS
SELECT id,student_name FROM t_student WHERE student_name='张耀仁';